var gulp = require('gulp');
var sass = require('gulp-sass');
var cssnext = require('gulp-cssnext');

var paths = {
  'scss': 'scss/'
};

gulp.task('scss', function() {
  return gulp.src('scss/system_style.scss')
    .pipe(sass({
      outputStyle: 'expanded'
    }))
    .on('error', function(err) {
      console.log(err.message);
    })
    .pipe(cssnext({
        browsers: ['last 2 versions']
    }))
    .pipe(gulp.dest('./'));
});

gulp.task('watch', function() {
  gulp.watch([paths.scss + '**/*.scss'], ['scss']);
});

gulp.task('default', ['scss', 'watch']);
